import request from '@/utils/request'

// 查询网络配置列表
export function listChannelSearch(query) {
  return request({
    url: '/system/channelSearchOneRestart/list',
    method: 'get',
    params: query
  })
}

//启动循环搜索
export function searchChannel(data){
  return request({
    url: '/system/channelSearchOneRestart/searchChannel',
    method: 'post',
    data: data
  })
}

//开始搜索
export function startSearchChannel(data){
  return request({
    url: '/system/channelSearchOneRestart/startSearchChannel',
    method: 'post',
    data: data
  })
}

export function stopChannel(data){
  return request({
    url: '/system/channelSearchOneRestart/stopChannel',
    method: 'post',
    data: data
  })
}
 // 设置合理的超时时间(毫秒)
  // const timeout = 30000; // 30秒
   const timeout = 300000; // 300秒 5分钟
//获取最新搜索到的平台
export function getChannelInfo(data){
  return request({
    url: '/system/channelSearchOneRestart/getChannelInfo',
    method: 'post',
    timeout: timeout, 
    data: data
  })
}

//分发默认平台
export function setChannelInfoRestart(data){
  return request({
    url: '/system/channelSearchOneRestart/setChannelInfoRestart',
    method: 'post',
    timeout: timeout, 
    data: data
  })
}


//一键配置功能入口
export function apiClearAgainScanById(data){
  return request({
    url: '/system/channelSearchOneRestart/clearAgainScanById',
    // timeout: timeout, 
    method: 'post',
    data: data
  })
}

